From c90d2d7bd22b4430834102732f2deb59a8bb8ab3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 22 Aug 2025 15:08:23 +0200 Subject: [PATCH] gdm/authPrompt: Fix key focus handling on choice list When a choice list widget is prompted in GDM we call updateSensitivity() but this does not act on the currently visible authentication widget but rather on the text entry all the times. And this causes that when a choice list is shown we always set the key focus to the (hidden) text entry. This implies that when the list is finally shown, moving the arrow keys leads makes the entry context menu to be shown instead of being able to navigate through the entries. So, make updateSensitivity use the currently visible authorization widget instead and use it to control the sensitivity of the choice list Part-of: --- js/gdm/authPrompt.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js index b9d35354f..800e2f185 100644 --- a/js/gdm/authPrompt.js +++ b/js/gdm/authPrompt.js @@ -520,13 +520,13 @@ export const AuthPrompt = GObject.registerClass({ this._authList.set({ opacity: 0, visible: true, - reactive: false, }); + this.updateSensitivity(false); this._authList.ease({ opacity: 255, duration: MESSAGE_FADE_OUT_ANIMATION_TIME, transition: Clutter.AnimationMode.EASE_OUT_QUAD, - onComplete: () => (this._authList.reactive = true), + onComplete: () => this.updateSensitivity(true), }); } @@ -593,18 +593,25 @@ export const AuthPrompt = GObject.registerClass({ } updateSensitivity(sensitive) { - if (this._entry.reactive === sensitive) + let authWidget; + + if (this._authList.visible) + authWidget = this._authList; + else + authWidget = this._entry; + + if (authWidget.reactive === sensitive) return; - this._entry.reactive = sensitive; + authWidget.reactive = sensitive; if (sensitive) { - this._entry.grab_key_focus(); + authWidget.grab_key_focus(); } else { this.grab_key_focus(); - if (this._entry === this._passwordEntry) - this._entry.password_visible = false; + if (authWidget === this._passwordEntry) + authWidget.password_visible = false; } } -- 2.39.5